package com.crscd.ai.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 10/9/25 4:09 PM
 * @modifiedBy:
 * @version: 1.0
 */
@Service
public class WeatherService {
  @Tool(description = "根据城市名称获取天气预报")
  public String getWeatherByCity(String city) {
    Map<String, String> map =
        Map.of(
            "北京", "降雨频繁，部分地区有暴雨并伴随强对流天气，需注意防范",
            "上海", "多云，17-35度，南风3级，当前温度27度",
            "深圳", "阴天，气温21-30度，南风1级");
    return map.getOrDefault(city, "抱歉，未能查到对应城市的天气");
  }
}
